package com.cong.patternpractise.singleton.doublecheck;

/**
 * Created by Cong
 * 双重检查
 */

public class SingletonBean {

    private static SingletonBean instance;

    private SingletonBean() {

    }

    public static SingletonBean getInstance() {
        if (instance == null) {
            synchronized (SingletonBean.class) {
                if (instance == null) {
                    instance = new SingletonBean();
                }
            }
        }
        return instance;
    }
}
